#pragma once
#include <string>
#include ".\cmpp_base.h"
#include ".\clientsocket.h"

using namespace std;

class CCMPP30Stream
{
public:
	CCMPP30Stream(void);
	~CCMPP30Stream(void);
private:
	ClientSocket sock;
	bool Write(string s);
	bool Read(string& s, size_t n);
public:
	bool Connect(string server, int port, Cmpp_Connect* pack);
	bool Write(Cmpp_Base * pack);
	Cmpp_Base * Read(void);
	void Terminate(Cmpp_Terminate * pack);
};
